package top.whysu.study.thinkinjava.chapter8.polymorphism.ex1;

/**
 * @description
 * @date 2021-07-19 14:52
 */
public class Test {

    /**
     * 习题1：Create a Cycle class, with subclasses Unicycle, Bicycle and Tricycle.
     * Demonstrate that an instance of each type can be upcast to Cycle via a ride() method.
     *
     * @param args
     */
    public static void main(String[] args) {
        Biking.ride(new BiCycle());
        Biking.ride(new UnCycle());
        // 打印
        // Cycle.ride() BiCycle
        // Cycle.ride() UnCycle
    }
}